package cn.doitedu.sql;

/**
 * @Author: 深似海
 * @Site: <a href="www.51doit.com">多易教育</a>
 * @QQ: 657270652
 * @Date: 2024/3/2
 * @Desc: 学大数据，上多易教育


 kafka中有如下用户行为记录：
{"uid":1,"event_id":"page_load","properties":{"url":"/a","ref":"/x"},"action_time":1704719574000}
{"uid":1,"event_id":"add_cart","properties":{"url":"/a","item_id":"p01"},"action_time":1704719575000}
{"uid":1,"event_id":"page_load","properties":{"url":"/b","ref":"/a"},"action_time":1704719576000}
{"uid":2,"event_id":"page_load","properties":{"url":"/a","ref":"/x"},"action_time":1704719577000}
{"uid":2,"event_id":"video_play","properties":{"url":"/a","video_id":"v01"},"action_time":1704719578000}
{"uid":2,"event_id":"page_load","properties":{"url":"/b","ref":"/x"},"action_time":1704719579000}

 统计如下实时报表：
     每 5分钟的加购物车行为次数和行为人数，统计结果写入mysql
     每 5分钟每种商品的加购次数和人数，统计结果写入mysql
     每天0点到当前，各类行为事件的发生人数和发生次数，统计结果写入mysql

     -- 每小时中，访问人数最多的前5个页面及其访问人数

     -- 挑战练习：在api的TumblingEventTimeWindows中利用自定义Trigger来实现 sql中的 cumulate窗口效果
        stream
          .keyBy()
          .window(TumblingEventTimeWindows.of(Time.ofHour(24)))
          .trigger(new MyTrigger())
 *
 *
 *
 *
 **/

public class _08_Exercise_SqlTest {
}
